#include <iostream>
#include <memory>

#include "mqtt_client.h"

int main(int avgc, char* avgs[]) {
  if (avgc != 2) {
    std::cout << "请输入你要发布到哪个主题" << std::endl;
    exit(2);
  }
  const std::string BROKER_ADDRESS = "tcp://192.168.202.1:1883";
  const std::string CLIENT_ID = "my_collector_publisher";
  const std::string TOPIC = avgs[1];
  std::shared_ptr<MqttBase> dcoll =
      std::make_shared<MqttPublisher>(BROKER_ADDRESS, CLIENT_ID, TOPIC, 2);
  dcoll->Run();
  return 0;
}